package com.enjoyor.health.HGPT.core.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.enjoyor.health.HGPT.core.entity.CommonInfo;
import com.enjoyor.health.HGPT.core.mapper.CommonInfoMapper;
import com.enjoyor.health.HGPT.core.service.ICommonInfoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author enjoyor
 * @since 2023-12-26
 */
@Service
public class CommonInfoServiceImpl extends ServiceImpl<CommonInfoMapper, CommonInfo> implements ICommonInfoService {

    @Override
    public List<CommonInfo> getByType(String type) {
        LambdaQueryWrapper<CommonInfo> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(CommonInfo::getType, type)
                .orderByAsc(CommonInfo::getNumber);
        return baseMapper.selectList(wrapper);
    }
}
